From 029364e5603e074d15d642f149bcc603e26e146d Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 7 Apr 2006 06:49:00 +0000 Subject: [PATCH] Remove more special casing and hackery with autoconf. --- Makefile.in | 33 +-- configure | 687 +++------------------------------------------------ configure.in | 36 ++- 3 files changed, 78 insertions(+), 678 deletions(-) diff --git a/Makefile.in b/Makefile.in index f6e5a6331..65e82d872 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,7 @@ VERSIOND=$(VERSD)$(RELEASE) # type that is XML-ish (i.e. gpx or geocaching.com's/loc) you can uncomment # INHIBIT_EXPAT and coment out LIBEXPAT on just to get a build working quickly. # INHIBIT_EXPAT=-DNO_EXPAT -LIBEXPAT=-lexpat # -lefence +LIBEXPAT=@EXPAT_LIB@ # -lefence # Space is significant, because MSVC wants no space between switch and arg (-Fofoo.o) # but cc/gcc does: @@ -28,7 +28,8 @@ OUTPUT_SWITCH=-o # OPTIMIZATION=-O $(EXTRA_OPTIMIZATION) DEBUGGING=-g $(EXTRA_DEBUGGING) # add -DDEBUG_MEM to turn on memory allocation logging -CFLAGS=$(EXTRA_CFLAGS) $(DEBUGGING) -Icoldsync $(INHIBIT_EXPAT) $(INHIBIT_USB) $(OPTIMIZATION) -I/sw/include +GBCFLAGS=$(EXTRA_CFLAGS) $(DEBUGGING) -Icoldsync \ + $(INHIBIT_USB) $(OPTIMIZATION) @CFLAGS@ INSTALL_TARGETDIR=/usr/local/ # OTHER_ROOT=/opt/local # For DarwinPorts on OSX @@ -51,12 +52,12 @@ FILTERS=position.o duplicate.o arcdist.o polygon.o smplrout.o \ reverse_route.o sort.o stackfilter.o trackfilter.o discard.o \ nukedata.o interpolate.o -OSJEEPS=jeeps/gpslibusb.o JEEPS=jeeps/gpsapp.o jeeps/gpscom.o \ jeeps/gpsmath.o jeeps/gpsmem.o \ jeeps/gpsprot.o jeeps/gpsread.o \ jeeps/gpsrqst.o jeeps/gpssend.o jeeps/gpsserial.o jeeps/gpsutil.o \ - jeeps/gpsusbread.o jeeps/gpsusbsend.o $(OSJEEPS) + jeeps/gpsusbread.o jeeps/gpsusbsend.o @OSJEEPS@ + # Extra modules in Jeeps that we don't use # jeeps/gpsfmt.o jeeps/gpsinput.o jeeps/gpsproj.o @@ -73,7 +74,9 @@ LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \ OBJS = main.o globals.o $(LIBOBJS) .c.o: - @CC@ -c $(CFLAGS) $< $(OUTPUT_SWITCH)$@ + @CC@ -c $(GBCFLAGS) $< $(OUTPUT_SWITCH)$@ + + # Directory of web doc WEB=../babelweb/ @@ -81,18 +84,14 @@ WEB=../babelweb/ all: gpsbabel -# -# Alternate makefile target for the case when you have no libusb and no -# need for Garmin/USB (60, 76C, VistaC, Quest, etc.) support. -# -#usbfree: -# make LIBUSB= INHIBIT_USB=-DNO_USB - gpsbabel: $(OBJS) - @CC@ $(CFLAGS) $(OBJS) @LIBS@ $(OUTPUT_SWITCH)$@ + @CC@ $(CFLAGS) $(OBJS) @LIBS@ @USB_LIBS@ $(LIBEXPAT) $(OUTPUT_SWITCH)$@ globals.o: - @CC@ -c $(CFLAGS) -DVERSION=\"$(VERSIOND)\" $< $(OUTPUT_SWITCH)$@ + @CC@ -c $(GBCFLAGS) -DVERSION=\"$(VERSIOND)\" $< $(OUTPUT_SWITCH)$@ + +jeeps/gpslibusb.o: + @CC@ -c $(GBCFLAGS) @USB_CFLAGS@ jeeps/gpslibusb.c $(OUTPUT_SWITCH)$@ clean: rm -f $(OBJS) gpsbabel gpsbabel.exe @@ -162,12 +161,6 @@ rpmrelease: curl -u anonymous:anonymous --upload-file /usr/src/redhat/SRPMS/gpsbabel-$(VERSIOND).src.rpm ftp://upload.sf.net/incoming/ curl -u anonymous:anonymous --upload-file /usr/src/redhat/RPMS/i386/gpsbabel-$(VERSIOND).i386.rpm ftp://upload.sf.net/incoming/ -#mac-usbfree: -# make LIBEXPAT=$(OTHER_ROOT)/lib/libexpat.a EXTRA_CFLAGS="-I$(OTHER_ROOT)/include" LIBUSB= INHIBIT_USB=-DNO_USB -# -#mac-build: -# make LIBEXPAT=$(OTHER_ROOT)/lib/libexpat.a EXTRA_CFLAGS="-I$(OTHER_ROOT)/include" LIBUSB="$(OTHER_ROOT)/lib/libusb.a -lIOKit -lBSDPClient -framework CoreFoundation" - mac-release: mkdir -p usr/bin usr/share/gpsbabel/doc cp gpsbabel usr/bin/ diff --git a/configure b/configure index 7ea17e674..aa5721b22 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for FULL-PACKAGE-NAME VERSION. +# Generated by GNU Autoconf 2.59 for GPSBabel VERSION. # # Report bugs to . # @@ -267,13 +267,13 @@ SHELL=${CONFIG_SHELL-/bin/sh} : ${ac_max_here_lines=38} # Identity of this package. -PACKAGE_NAME='FULL-PACKAGE-NAME' -PACKAGE_TARNAME='full-package-name' +PACKAGE_NAME='GPSBabel' +PACKAGE_TARNAME='gpsbabel' PACKAGE_VERSION='VERSION' -PACKAGE_STRING='FULL-PACKAGE-NAME VERSION' +PACKAGE_STRING='GPSBabel VERSION' PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS' -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LIBUSBCONFIG CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LIBUSBCONFIG USB_LIBS USB_CFLAGS OSJEEPS EXPAT_LIB LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -730,10 +730,6 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -742,7 +738,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures FULL-PACKAGE-NAME VERSION to adapt to many kinds of systems. +\`configure' configures GPSBabel VERSION to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -799,7 +795,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of FULL-PACKAGE-NAME VERSION:";; + short | recursive ) echo "Configuration of GPSBabel VERSION:";; esac cat <<\_ACEOF @@ -810,7 +806,6 @@ Some influential environment variables: nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -911,7 +906,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -FULL-PACKAGE-NAME configure VERSION +GPSBabel configure VERSION generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -925,7 +920,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by FULL-PACKAGE-NAME $as_me VERSION, which was +It was created by GPSBabel $as_me VERSION, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -2423,6 +2418,7 @@ echo $ECHO_N "checking for libusb... $ECHO_C" >&6 if test "$with_libusb" = no ; then echo "$as_me:$LINENO: result: check not done" >&5 echo "${ECHO_T}check not done" >&6 + OSJEEPS=jeeps/gpsusbstub.o else # Extract the first word of "libusb-config", so it can be a program name with args. set dummy libusb-config; ac_word=$2 @@ -2535,8 +2531,13 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_interrupt_read" >&5 echo "${ECHO_T}$ac_cv_lib_usb_usb_interrupt_read" >&6 if test $ac_cv_lib_usb_usb_interrupt_read = yes; then - USB_FLAGS="`libusb-config --cflags`" - LDFLAGS="$LDFLAGS `libusb-config --libs`" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBUSB 1 +_ACEOF + + USB_CFLAGS="`libusb-config --cflags`" + USB_LIBS="`libusb-config --libs`" else { { echo "$as_me:$LINENO: error: libusb >= 0.1.8 is needed" >&5 echo "$as_me: error: libusb >= 0.1.8 is needed" >&2;} @@ -2544,83 +2545,14 @@ echo "$as_me: error: libusb >= 0.1.8 is needed" >&2;} fi + OSJEEPS=jeeps/gpslibusb.o CFLAGS="$OCFLAGS" - LIBS="$LIBS `libusb-config --libs`" - -echo "$as_me:$LINENO: checking for usb_interrupt_read in -lusb" >&5 -echo $ECHO_N "checking for usb_interrupt_read in -lusb... $ECHO_C" >&6 -if test "${ac_cv_lib_usb_usb_interrupt_read+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lusb $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char usb_interrupt_read (); -int -main () -{ -usb_interrupt_read (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_usb_usb_interrupt_read=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_usb_usb_interrupt_read=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +# LIBS="$LIBS `libusb-config --libs`" fi -echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_interrupt_read" >&5 -echo "${ECHO_T}$ac_cv_lib_usb_usb_interrupt_read" >&6 -if test $ac_cv_lib_usb_usb_interrupt_read = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUSB 1 -_ACEOF - LIBS="-lusb $LIBS" -fi -fi + echo "$as_me:$LINENO: checking for random stuff to make you feel better" >&5 echo $ECHO_N "checking for random stuff to make you feel better... $ECHO_C" >&6 @@ -2633,146 +2565,16 @@ if test "$with_libexpat" = no ; then echo "$as_me:$LINENO: result: check not done" >&5 echo "${ECHO_T}check not done" >&6 else -# AC_CHECK_LIB([expat], [XML_ParserCreate]) - echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 -echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 -if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lexpat "-L/sw/lib -I/sw/include" $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XML_ParserCreate (); -int -main () -{ -XML_ParserCreate (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_expat_XML_ParserCreate=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_expat_XML_ParserCreate=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 -if test $ac_cv_lib_expat_XML_ParserCreate = yes; then - EXPAT_LIB="-lexpat" -else - echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 -echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 -if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lexpat "-L/sw/lib -I/sw/include" $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XML_ParserCreate (); -int -main () -{ -XML_ParserCreate (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_expat_XML_ParserCreate=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_expat_XML_ParserCreate=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 -if test $ac_cv_lib_expat_XML_ParserCreate = yes; then - EXPAT_LIB="-lexpat" -fi - -fi +# Special case fink test. + if test -f /sw/include/expat.h; then + CFLAGS="$CFLAGS -I/sw/include" + fi + if test -f /sw/include/expat.h; then + LDFLAGS="$LDFLAGS -L/sw/lib" + fi -echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 + echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2837,432 +2639,19 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 if test $ac_cv_lib_expat_XML_ParserCreate = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - - LIBS="-lexpat $LIBS" - -fi - -fi - -# Checks for header files. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBEXPAT 1 _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* + EXPAT_LIB="$LDFLAGS -lexpat" fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF -fi +# Checks for header files. +# AC_HEADER_STDC # AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/time.h termios.h unistd.h]) @@ -3654,7 +3043,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by FULL-PACKAGE-NAME $as_me VERSION, which was +This file was extended by GPSBabel $as_me VERSION, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3714,7 +3103,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -FULL-PACKAGE-NAME config.status VERSION +GPSBabel config.status VERSION configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -3915,8 +3304,10 @@ s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@LIBUSBCONFIG@,$LIBUSBCONFIG,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t +s,@USB_LIBS@,$USB_LIBS,;t t +s,@USB_CFLAGS@,$USB_CFLAGS,;t t +s,@OSJEEPS@,$OSJEEPS,;t t +s,@EXPAT_LIB@,$EXPAT_LIB,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/configure.in b/configure.in index 7d09faab0..629853f03 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) +AC_INIT(GPSBabel, VERSION, BUG-REPORT-ADDRESS) # AC_CONFIG_SRCDIR([nmea.c]) AC_CONFIG_HEADER([config.h]) @@ -28,6 +28,7 @@ AC_CHECK_LIB([m], [cos]) AC_MSG_CHECKING(for libusb) if test "$with_libusb" = no ; then AC_MSG_RESULT(check not done) + OSJEEPS=jeeps/gpsusbstub.o else AC_CHECK_PROG(LIBUSBCONFIG, libusb-config, true, false) if test "$LIBUSBCONFIG" = false; then @@ -39,15 +40,20 @@ else CFLAGS="$OCFLAGS `libusb-config --cflags`" AC_CHECK_LIB([usb], [usb_interrupt_read], - [USB_FLAGS="`libusb-config --cflags`"] - [LDFLAGS="$LDFLAGS `libusb-config --libs`"], + AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb]) + [USB_CFLAGS="`libusb-config --cflags`"] + [USB_LIBS="`libusb-config --libs`"], [AC_MSG_ERROR([libusb >= 0.1.8 is needed])] ) + OSJEEPS=jeeps/gpslibusb.o CFLAGS="$OCFLAGS" - LIBS="$LIBS `libusb-config --libs`" - AC_CHECK_LIB([usb], [usb_interrupt_read]) +# LIBS="$LIBS `libusb-config --libs`" fi +AC_SUBST(USB_LIBS) +AC_SUBST(USB_CFLAGS) +AC_SUBST(OSJEEPS) + AC_MSG_CHECKING(for random stuff to make you feel better) AC_MSG_RESULT(failed) @@ -55,14 +61,24 @@ AC_MSG_CHECKING(for libexpat) if test "$with_libexpat" = no ; then AC_MSG_RESULT(check not done) else -# AC_CHECK_LIB([expat], [XML_ParserCreate]) - AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LIB="-lexpat", - AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LIB="-lexpat", [], "-L/sw/lib -I/sw/include"), "-L/sw/lib -I/sw/include") - AC_CHECK_LIB(expat, XML_ParserCreate) + +# Special case fink test. + if test -f /sw/include/expat.h; then + CFLAGS="$CFLAGS -I/sw/include" + fi + if test -f /sw/include/expat.h; then + LDFLAGS="$LDFLAGS -L/sw/lib" + fi + + AC_CHECK_LIB([expat], [XML_ParserCreate], + AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) + [EXPAT_LIB="$LDFLAGS -lexpat"]) fi +AC_SUBST(EXPAT_LIB) # Checks for header files. -AC_HEADER_STDC +# AC_HEADER_STDC + # AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/time.h termios.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. -- 2.30.2